﻿<UserControl
    x:Class="WinRTXamlToolkit.Sample.Views.ListViewExtensionsItemToBringIntoViewTestView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:WinRTXamlToolkit.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Extensions="using:WinRTXamlToolkit.Controls.Extensions"
    mc:Ignorable="d">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition
                Height="Auto" />
            <RowDefinition />
            <RowDefinition
                Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <TextBlock
            Text="SourceListView"
            Margin="0,0,0,15"
            Style="{StaticResource SubheaderTextStyle}" />
        <ListView
            x:Name="SourceListView"
            ItemsSource="{Binding MyItems}"
            SelectionMode="Single"
            Extensions:ListViewExtensions.ItemToBringIntoView="{Binding SelectedItem, ElementName=TargetListView}"
            Grid.Row="1" />

        <TextBlock
            Text="TargetListView"
            Grid.Column="1"
            Margin="0,0,0,15"
            Style="{StaticResource SubheaderTextStyle}" />
        <ListView
            x:Name="TargetListView"
            ItemsSource="{Binding MyItems}"
            SelectionMode="Single"
            Extensions:ListViewExtensions.ItemToBringIntoView="{Binding SelectedItem, ElementName=SourceListView}"
            Grid.Row="1"
            Grid.Column="1" />

        <TextBlock
            Text="Select an item in one list to have it brought into view in another - one line of XAML with binding."
            Grid.Row="2"
            Grid.ColumnSpan="2"
            Margin="0,0,0,15"
            Style="{StaticResource SubheaderTextStyle}" />
    </Grid>
</UserControl>
